package com.zjsru.controller;

import com.zjsru.pojo.Order;
import com.zjsru.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/*@Controller
@ResponseBody*/
@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;
    //根据商品ID查询商品信息
   /* @GetMapping("/order/query/{id}")
    public String queryOrderById(@PathVariable("id") Long orderId) {
        return "ID为"+orderId+"订单查询成功";
    }*/
    //根据商品ID查询商品信息及用户信息
    @GetMapping("/order/query/{id}")
    public Order queryOrderById(@PathVariable("id") Long orderId) {
        return orderService.queryOrderById(orderId);
    }

}
